#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
using namespace std;
int main()
{
	int n;
	int q=0;
	cin >> n;
	int m = n;
	if (n >= 1000 || n <= 99) {
		cout << "Invalid Value";
	}
	else {
		for (int i = 0; i < 3; i++) {
			q += (n % 10) * (n % 10) * (n % 10);
			n /= 10;
		}
		if (q == m) {
			cout << "Yes" << endl;
		}
		else {
			cout << "No" << endl;
		}
	}

	return 0;
}